<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>分数评定</title>
<style>
	.a1{ margin:0 auto;}
</style>
</head>

<body>
	<script language="javascript">
		function rec(form){
			var a=form.text1.value;
			var b=parseInt(a/10);
			switch(b){
					case 10: 
					case 9: alert("成绩优秀");break;
					case 8: alert("成绩良好");break;
					case 7: 
					case 6: alert("成绩及格");break;
					case 5: 
					case 4: 
					case 3: 
					case 2: 
					case 1: 
					case 0: alert("成绩不及格");break;
				}
			}
	</script>
	<form>
        <div class="a1"><input type="text" name="text1"><br><br>
						<input type="button" name="text2" value="评定" onClick="rec(this.form)">
        </div>
    </form>
</body>

</html>
